'\" te
.\"  Copyright 1989 AT&T
.\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
.\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
.TH DUPMSG 9F "Apr 11, 1991"
.SH NAME
dupmsg \- duplicate a message
.SH SYNOPSIS
.LP
.nf
#include <sys/stream.h>



\fBmblk_t *\fR\fBdupmsg\fR(\fBmblk_t *\fR\fImp\fR);
.fi

.SH INTERFACE LEVEL
.sp
.LP
Architecture independent level 1 (DDI/DKI).
.SH PARAMETERS
.sp
.ne 2
.na
\fB\fImp\fR \fR
.ad
.RS 7n
Pointer to the message.
.RE

.SH DESCRIPTION
.sp
.LP
\fBdupmsg()\fR forms a new message by copying the message block descriptors
pointed to by  \fImp\fR and linking them. \fBdupb\fR(9F) is called for each
message block. The data blocks themselves are not duplicated.
.SH RETURN VALUES
.sp
.LP
If successful,  \fBdupmsg()\fR returns a pointer to the new message block.
Otherwise, it returns a  \fINULL\fR pointer. A return value of  \fINULL\fR
indicates either memory depletion or the data block reference count,
\fBdb_ref\fR (see \fBdatab\fR(9S)), has reached a limit  (\fB255\fR). See
\fBdupb\fR(9F).
.SH CONTEXT
.sp
.LP
\fBdupmsg()\fR can be called from user, kernel, or interrupt context.
.SH EXAMPLES
.LP
\fBExample 1 \fRUsing \fBdupmsg()\fR
.sp
.LP
See \fBcopyb\fR(9F) for an example using \fBdupmsg()\fR.

.SH SEE ALSO
.sp
.LP
.BR copyb (9F),
.BR copymsg (9F),
.BR dupb (9F),
.BR datab (9S)
.sp
.LP
\fIWriting Device Drivers\fR
.sp
.LP
\fISTREAMS Programming Guide\fR
